<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:sf="http://www.springframework.org/tags/faces"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:spring="http://www.springframework.org/tags"
                template="../../../layout/Template.xhtml">

    <ui:define name="menu">
        <ui:include src="${user.menu}"/>
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{resourceBundle.createFieldWorkWelcome}"/>
    </ui:define>

    <ui:define name="content">
        <ui:fragment id="createFieldWorkFragment">
            <rich:panel id="createFieldWorkPanel" header="#{resourceBundle.createFieldWorkWelcome}">
                <h:form id="createFieldWorkForm">
                    <h:panelGrid id="createFieldWorkGrid" columns="3">
                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormSubject} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.subject}"
                                id="subject" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageSubject}"/>
                        <h:message for="subject" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormContain} : "/>
                        <rich:editor
                                value="#{viewScope.createdFieldWork.contain}"
                                id="contain" required="true"
                                theme="advanced"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageContain}">
                            <f:param name="theme_advanced_toolbar_location" value="top"/>
                            <f:param name="theme_advanced_toolbar_align" value="left"/>
                        </rich:editor>
                        <h:message for="contain" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormCorrection} : "/>
                        <rich:editor
                                value="#{viewScope.createdFieldWork.correction}"
                                id="correction"
                                required="true"
                                theme="advanced"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageCorrection}">
                            <f:param name="theme_advanced_toolbar_location" value="top"/>
                            <f:param name="theme_advanced_toolbar_align" value="left"/>
                        </rich:editor>
                        <h:message for="correction" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormLinkSupport} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.linkSupport}"
                                id="linkSupport" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageLinkSupport}"/>
                        <h:message for="linkSupport" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormLinkCorrection} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.linkCorrection}"
                                id="linkCorrection" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageLinkCorrection}"/>
                        <h:message for="linkCorrection" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormStartTime} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.startTime}"
                                id="startTime" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageStartTime}"
                                converterMessage="#{resourceBundle.createFieldWorkConverterMessageStartTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="startTime" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormEndTime} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.endTime}"
                                id="endTime" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageEndTime}"
                                converterMessage="#{resourceBundle.createFieldWorkConverterMessageEndTime}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="endTime" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.date}"
                                id="date" required="true"
                                requiredMessage="#{resourceBundle.createFieldWorkRequiredMessageDate}"
                                converterMessage="#{resourceBundle.createFieldWorkConverterMessageDate}">
                            <f:convertDateTime pattern="dd/MM/yy"
                                               type="date"/>
                        </h:inputText>
                        <h:message for="date" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormDeadLineHour} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.deadLineHour}"
                                id="deadLineHour"
                                converterMessage="#{resourceBundle.createFieldWorkConverterMessageDeadLineHour}">
                            <f:convertDateTime pattern="HH:mm" type="time"/>
                        </h:inputText>
                        <h:message for="deadLineHour" style="color:red"/>

                        <h:outputText
                                value="#{resourceBundle.createFieldWorkFormDeadLineDate} : "/>
                        <h:inputText
                                value="#{viewScope.createdFieldWork.deadLineDate}"
                                id="deadLineDate"
                                converterMessage="#{resourceBundle.createFieldWorkConverterMessageDeadLineDate}">
                            <f:convertDateTime pattern="dd/MM/yy"
                                               type="date"/>
                        </h:inputText>
                        <h:message for="deadLineDate" style="color:red"/>

                    </h:panelGrid>

                    <h:messages globalOnly="true"/>

                    <a4j:commandButton type="submit" value="#{bundle.addButton}" action="add"/>
                    <a4j:commandButton value="#{bundle.cancelButton}" action="cancel" immediate="true"/>
                </h:form>
            </rich:panel>
        </ui:fragment>
    </ui:define>

</ui:composition>